<template>

  <div class="article-box">
    <h1 v-text="articleInfo.articleTitle"></h1>
    <div v-html="articleInfo.bodyContentHtml" class="article-content"></div>
  </div>

</template>

<script>
import {getArticleById} from "@/request/api/article";

export default {
  name: "ArticleView",
  props: ['articleId'],
  data() {
    const articleInfo = {
      articleTitle: '',
      bodyContentHtml: ''
    }
    return {
      articleInfo
    }
  },
  created() {
  },
  mounted() {
    let id = this.articleId;
    getArticleById(id).then(res => {
      this.articleInfo = res.data;
    })
  }
}
</script>

<style lang="scss" scoped>
.article-box {
  background-color: #9a6e3a;
  border-radius: 15px;
  width: 800px;
  margin: 20px auto;
  padding: 10px;
  h1 {
    text-align: center;
  }
  .article-content {
    width: 100%;
    margin-top: 20px;
    font-size: 1.25rem;
  }
}

</style>